package com.xuecheng.test.rabbitmq.mq;

import com.rabbitmq.client.Channel;
import com.xuecheng.test.rabbitmq.config.RabbitmqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author Andrew Yang
 * @ClassName ReceiveHandler
 * @Description
 * @Package com.xuecheng.test.rabbitmq.mq
 * @create 2020-02-05 23:24
 */
@Component
public class ReceiveHandler {
    @RabbitListener(queues={RabbitmqConfig.QUEUE_INFORM_EMAIL})
    public void receiveEmail(String msg, Message message, Channel channel) {
        System.out.println("email:"+msg);
    }
    @RabbitListener(queues={RabbitmqConfig.QUEUE_INFORM_SMS})
    public void receiveSms(String msg, Message message, Channel channel) {
        System.out.println("sms:"+msg);
    }

}
